package com.way;

/**
 * @author 魏彪
 */
public class Test06 {

    public static void main(String[] args) {
        DataBuffer dataBuffer = new DataBuffer();

        for (int i = 0; i < 10; i++) {
            Producer producer = new Producer(dataBuffer);
            Thread producerThread = new Thread(producer);
            producerThread.start();
        }


        for (int i = 0; i < 10; i++) {
            Consumer consumer = new Consumer(dataBuffer);
            Thread consumerThread = new Thread(consumer);
            consumerThread.start();
        }

    }
}
